using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SkeletonAnimationTrigger : MonoBehaviour
{
    private Enemy_Skeleton enemey => GetComponentInParent<Enemy_Skeleton>();

    private void AnimationTrigger()
    {
        enemey.AnimationFinishTrigger();
    }

    private void AttackTriggger()

    {
        Collider2D[] colliders = Physics2D.OverlapCircleAll(enemey.attackCheck.position, enemey.attackCheckRadius);

        foreach (var hit in colliders)
        {
            if (hit.GetComponent<Player>() != null)
            {
                PlayerStats target = hit.GetComponent<PlayerStats>();

                enemey.stats.DoDamage(target);
            }
        }
    }
}
